package org.dreamwork.jasmine2.web.misc;

import org.dreamwork.jasmine2.web.controls.WebControl;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 12-6-5
 * Time: 上午10:42
 */
public class ParameterControl extends WebControl {
    private String name, value;

    public ParameterControl () {
        htmlTagName = "";
    }

    public String getName () {
        return name;
    }

    public void setName (String name) {
        this.name = name;
    }

    public String getValue () {
        return value;
    }

    public void setValue (String value) {
        this.value = value;
    }

    @Override
    public void init () {
        if (! (parent instanceof IncludeControl))
            throw new ClassCastException ("Can't cast " + parent + " to org.dreamwork.jasmine2.web.misc.IncludeControl");
        IncludeControl include = (IncludeControl) parent;
        include.parameters.put (name, value);
    }
}